\section{cross --- Vector cross product}
\label{fn:cross}
\index{cross()}
\index{vector cross product}
\index{triple product}
\begin{rail}
Cross : 'cross' '(' Matrix ',' Matrix ')' ;
\end{rail}

\verb+cross+ calculates the vector cross product of the two
argument matrices.  Both arguments must have three elements, though
they need not be organised the same way.  The result of the cross
product is returned as a $1x3$ matrix.

$\Longrightarrow$ This is not an \RLaB\ built-in function.  This function
is normally loaded on start-up from the \verb+cross.r+ file in the
standard \verb+rlib+ directory. Use of the \verb+-r+ option, incorrectly 
setting the \verb+RLAB_LIB_DIR+ environmental variable, or modifying
\verb+cross.r+ may make this function unavailable.
 
\paragraph{Example}
\index{example of cross()}
\index{cross!example}
\begin{verbatim}
> a = [0,0,1]
 a =
        0          0          1  
> b = [1;0;0]
 b =
        1  
        0  
        0  
> c = cross(a,b)
 c =
        0          1          0  
> d = cross(a,c)
 d =
       -1         -0          0  
> d = cross(c,a)
 d =
        1         -0          0  
> e = [1,1,1]
 e =
        1          1          1  
> cross(a,e)
       -1          1          0  
> cross(c,e)
        1         -0         -1  
\end{verbatim}

See also: Page~\pageref{fn:dot} \verb+dot()+.

\newpage






